$.ajax({
    method:'get',
    url:'http://chst.vip:1234/api/getcoupon',
    success:function(res){
        let astr = ''
        res.result.forEach((element,index) => {
            console.log(element);
            astr+=`  <a href="http://127.0.0.1:5500/domo/千锋商城项目/html/couponin.html?couponId=${element.couponId}" couponid=${element.couponId}>
                        <img src="./../千锋商城img/pic${index+1}.webp" alt="">
                        <p>${element.couponTitle}</p>
                    </a>`
        });
        $('main nav').html(astr)
        $('main .tip p span:eq(0)').click(function(){
            location.href = 'http://127.0.0.1:5500/domo/千锋商城项目/html/主页.html'
        })
    }
    
})